 //
//  YingYeShiJianKeFuDianHuaHelper.m
//  FD
//
//  Created by xiaofang wang on 2018/11/10.
//  Copyright © 2018年 ZhiYuan Network. All rights reserved.


#import "YingYeShiJianKeFuDianHuaHelper.h"

@implementation YingYeShiJianKeFuDianHuaHelper
/**1.获取平台客服电话*/
+ (void)obtainKeFuDianHuaBlock:(void(^)(NSString *phone))complection
{
    [FDHttpAPi requestKeFuDianHuaSuccessBlock:^(id responseObjc) {
        NSString *event = responseObjc[@"event"];
        if ([event isEqualToString:SUCCESS]) {
            NSString *phone = responseObjc[@"data"][@"phone"];
            
            //回调
            if (complection) {
                complection(phone);
            }
        }else {
            FDLog(@"/configuration/custom_service_phone:接口报错:%@",responseObjc[describe]);
        }
    } failBlock:^(NSError *error) {
            FDLog(@"/configuration/custom_service_phone:接口报错:%@",error);
    }];
}

/**2.平台营业开始时间active  结束时间  quiet */
+ (void)obtainYingYeShiJianComplectionBlock:(void(^)(NSString *active, NSString *quiet))complection
{
    [FDHttpAPi requestYinGYeShiJianSuccessBlock:^(id responseObjc) {

        NSString *event = responseObjc[@"event"];
        if ([event isEqualToString:SUCCESS]) {
            
            NSString *begin = responseObjc[@"data"][@"active"];
            NSString *end   = responseObjc[@"data"][@"quiet"];
            
            //回调
            if (complection) {
                complection(begin, end);
            }
        }else {
            FDLog(@"/configuration/custom_service_time:接口报错:%@",responseObjc[describe]);

        }
    } failBlock:^(NSError *error) {
        FDLog(@"/configuration/custom_service_phone:接口报错:%@",error);

    }];
}

@end
